using System;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Diagnostics.CodeAnalysis;
using PetaPoco;

namespace BlazorAdmin.Models
{
	[PrimaryKey("ID")]
	[TableName($"{nameof(Log)}s")]
	public class Log
    {
		/// <summary>
		/// 获得/设置 Id
		/// </summary>
		[NotNull]
		public virtual int ID { get; set; }

		/// <summary>
		/// 获取或设置 请求方 Allow DBNull
		/// </summary>
		[AllowNull]
		[DisplayName("请求方")]
		[MaxLength(50, ErrorMessage = "{0}不能超过 50 个字符")]
		public string RequestUser { get; set; }

		/// <summary>
		/// 获取或设置 请求地址 Allow DBNull
		/// </summary>
		[AllowNull]
		[DisplayName("请求地址")]
		[MaxLength(500, ErrorMessage = "{0}不能超过 500 个字符")]
		public string RequestUrl { get; set; }

		/// <summary>
		/// 获取或设置 请求参数 Allow DBNull
		/// </summary>
		[AllowNull]
		[DisplayName("请求参数")]
		public string RequestData { get; set; }

		/// <summary>
		/// 获取或设置 方法 Allow DBNull
		/// </summary>
		[AllowNull]
		[DisplayName("方法")]
		[MaxLength(20, ErrorMessage = "{0}不能超过 20 个字符")]
		public string RequestMethod { get; set; }

		/// <summary>
		/// 获取或设置 请求协议 Allow DBNull
		/// </summary>
		[AllowNull]
		[DisplayName("协议")]
		[MaxLength(50, ErrorMessage = "{0}不能超过 50 个字符")]
		public string RequestProtocol { get; set; }

		/// <summary>
		/// 获取或设置 接口描述 Allow DBNull
		/// </summary>
		[AllowNull]
		[DisplayName("接口描述")]
		[MaxLength(50, ErrorMessage = "{0}不能超过 50 个字符")]
		public string BizID { get; set; }

		/// <summary>
		/// 获取或设置 客户端IP Allow DBNull
		/// </summary>
		[AllowNull]
		[DisplayName("客户端IP")]
		[MaxLength(15, ErrorMessage = "{0}不能超过 15 个字符")]
		public string ClientIP { get; set; }

		/// <summary>
		/// 获取或设置 客户端浏览器 Allow DBNull
		/// </summary>
		[AllowNull]
		[DisplayName("浏览器")]
		[MaxLength(50, ErrorMessage = "{0}不能超过 50 个字符")]
		public string Browser { get; set; }

		/// <summary>
		/// 获取或设置 客户端系统 Allow DBNull
		/// </summary>
		[AllowNull]
		[DisplayName("系统")]
		[MaxLength(50, ErrorMessage = "{0}不能超过 50 个字符")]
		public string OS { get; set; }

		/// <summary>
		/// 获取或设置 用户代理 Allow DBNull
		/// </summary>
		[AllowNull]
		[DisplayName("用户代理")]
		[MaxLength(2000, ErrorMessage = "{0}不能超过 2000 个字符")]
		public string UserAgent { get; set; }

		/// <summary>
		/// 获取或设置 日志时间 Allow DBNull
		/// </summary>
		[AllowNull]
		[DisplayName("日志时间")]
		public DateTime LogTime { get; set; }
	}
}
